package edu.gdut.thesissys.vo;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Scheduling entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "scheduling", catalog = "gdutmis")
public class Scheduling extends BaseVo implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8254105596252214708L;
	// Fields

	private Integer schedulingId;
	private TaskBook taskBook;
	private String content;
	private Date startDate;
	private Date endDate;

	// Constructors

	/** default constructor */
	public Scheduling() {
	}

	/** minimal constructor */
	public Scheduling(TaskBook taskBook) {
		this.taskBook = taskBook;
	}

	/** full constructor */
	public Scheduling(TaskBook taskBook, String content, Date startDate,
			Date endDate) {
		this.taskBook = taskBook;
		this.content = content;
		this.startDate = startDate;
		this.endDate = endDate;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "scheduling_id", unique = true, nullable = false)
	public Integer getSchedulingId() {
		return this.schedulingId;
	}

	public void setSchedulingId(Integer schedulingId) {
		this.schedulingId = schedulingId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "task_book_id", nullable = false)
	public TaskBook getTaskBook() {
		return this.taskBook;
	}

	public void setTaskBook(TaskBook taskBook) {
		this.taskBook = taskBook;
	}

	@Column(name = "Content", length = 100)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", length = 10)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}